import Cookies from 'js-cookie'

const TokenKey = 'token'   // 为空会报错

export function getToken() {
    return Cookies.get(TokenKey)
}

export function setToken(token) {
    // Cookies.expires = 7200//负值浏览器删除cookie
    // Cookies.setMaxAge(-1)
    return Cookies.set(TokenKey, token, {expires: 1})
}

export function removeToken() {
    return Cookies.remove(TokenKey)
}